#include <bits/stdc++.h>
// 2025/02/05
// tag: 
// Author: Zhang Muen
using namespace std;

using int64 = int64_t;

int V, n, c, wei[10001], val[10001], dp[10001];

signed main()
{
    cin >> V >> n >> c;
    for (int i = 1; i <= n; i++)
        cin >> val[i] >> wei[i];
    for (int i = 1; i <= n; i++)
        for (int j = c; j >= wei[i]; j--)
            dp[j] = max(dp[j], dp[j - wei[i]] + val[i]);
    if (dp[c] < V)
        cout << "Impossible" << endl;
    else
        cout << c - (upper_bound(dp + 1, dp + c + 1, V - 1) - dp) << endl;
    return 0;
}